package com.tuanzhang.mall.goods.domain.valueobj;

import com.tuanzhang.mall.seller.types.exception.ApiException;

/**
 * 类功能描述
 *
 * @author wangyl
 * @date 2025/6/17
 */
public class MoneyRange {
    private Money minPrice;
    private Money maxPrice;

    private MoneyRange(){

    }

    private MoneyRange(Money minPrice, Money maxPrice){
        if (null == minPrice || null == maxPrice) {
            throw new ApiException("参数不能为空");
        }
        this.minPrice = minPrice;
        this.maxPrice = maxPrice;
    }

    public static MoneyRange getMoneyRange(Money minPrice, Money maxPrice){
        return new MoneyRange(minPrice, maxPrice);
    }
}
